package com.books.mapper.login_regis;/*
 *@Auther Zhourui
 *@data 2021/9/26  19:43
 *@Email 1605576647@qq.com
 */


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.books.model.entity.common.People;
import com.books.model.entity.login_regis.UserLogin;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;


public interface UserLoginMapper extends BaseMapper<UserLogin> {
    @Select("select * from user_login where uname=#{uname}")
    UserLogin findByUsername(String uname);

    @Select("select * from user_login where account=#{account}")
    UserLogin findByAccount(String account);

    @Select("select * from user_login where email=#{email}")
    UserLogin findByEmail(String email);

    @Update("update people set head_url=#{people.headUrl},id_num=#{people.idNum},name=#{people.name},sex=#{people.sex},age=#{people.age},birthday=#{people.birthday},email=#{people.email},qq=#{people.qq},wx=#{people.wx},vip_id=#{people.vipId},address=#{people.address},question=#{people.question},answer=#{people.answer},status_id=#{people.statusId} where people_id=#{peopleId}")
    void updatePeople(People people, Integer peopleId);

    @Update ("update user_login set email=#{email},password=#{psw} where account=#{account}")
    void updateUserLogin(String psw,String email,String account);

    @Update ("update user_login set password=#{psw} where email=#{email}")
    void updateUserPwd(String psw,String email);


}
